package com.qfjy.homework.huangjie;

import java.util.ArrayList;
import java.util.List;

/**
 * @author:黄杰
 * @date:
 * @version:1.0
 */
public class AgencyImpl implements Agency {
    List<Person> people = new ArrayList<>();
    @Override
    public void register(Person person) {
        people.add(person);
    }

    @Override
    public void pair(Person person) {
        for(Person p : people){
            if(p.age == person.requestAge && p.sex !=person.sex){
                System.out.println(person.name+"与"+p.name+"配对成功");
            }
        }
    }
}
